{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# python数据分析期末项目\n",
    "*  项目名称：2020年北上广深空气质量对比\n",
    "*  电子讲义设计者：朱卫彬\n",
    "*  撰写日期：7月3日"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style>\n",
       "/* 本电子讲义使用之CSS */\n",
       "div.code_cell {\n",
       "    background-color: #e5f1fe;\n",
       "}\n",
       "div.cell.selected {\n",
       "    background-color: #effee2;\n",
       "    font-size: 2rem;\n",
       "    line-height: 2.4rem;\n",
       "}\n",
       "div.cell.selected .rendered_html table {\n",
       "    font-size: 2rem !important;\n",
       "    line-height: 2.4rem !important;\n",
       "}\n",
       ".rendered_html pre code {\n",
       "    background-color: #C4E4ff;   \n",
       "    padding: 2px 25px;\n",
       "}\n",
       ".rendered_html pre {\n",
       "    background-color: #99c9ff;\n",
       "}\n",
       "div.code_cell .CodeMirror {\n",
       "    font-size: 2rem !important;\n",
       "    line-height: 3.6rem !important;\n",
       "}\n",
       ".rendered_html img, .rendered_html svg {\n",
       "    max-width: 60%;\n",
       "    height: auto;\n",
       "    float: right;\n",
       "}\n",
       "\n",
       ".rendered_html img[src*=\"#full\"], .rendered_html svg[src*=\"#full\"] {\n",
       "    max-width: 100%;\n",
       "    height: auto;\n",
       "    float: none;\n",
       "}\n",
       "\n",
       ".rendered_html img[src*=\"#thumbnail\"], .rendered_html svg[src*=\"#thumbnail\"] {\n",
       "    max-width: 15%;\n",
       "    height: auto;\n",
       "}\n",
       ".rendered_html img[src*=\"#thumbnailauto\"], .rendered_html svg[src*=\"#thumbnail\"] {\n",
       "    max-width: auto;\n",
       "    height: auto;\n",
       "}\n",
       "\n",
       "/* Gradient transparent - color - transparent */\n",
       "hr {\n",
       "    border: 0;\n",
       "    border-bottom: 1px dashed #ccc;\n",
       "}\n",
       ".emoticon{\n",
       "    font-size: 5rem;\n",
       "    line-height: 4.4rem;\n",
       "    text-align: center;\n",
       "    vertical-align: middle;\n",
       "}\n",
       ".bg-reshape {\n",
       "    width: 550px;\n",
       "    height: 205px;\n",
       "    background: url('../20春_pandas_CheatSheet.svg') -205px -110px;\n",
       "    float: left;\n",
       "}\n",
       ".break {\n",
       "                   page-break-after: right; \n",
       "                   width:100%;\n",
       "                   clear:both;\n",
       "}\n",
       "</style>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%html\n",
    "<style>\n",
    "/* 本电子讲义使用之CSS */\n",
    "div.code_cell {\n",
    "    background-color: #e5f1fe;\n",
    "}\n",
    "div.cell.selected {\n",
    "    background-color: #effee2;\n",
    "    font-size: 2rem;\n",
    "    line-height: 2.4rem;\n",
    "}\n",
    "div.cell.selected .rendered_html table {\n",
    "    font-size: 2rem !important;\n",
    "    line-height: 2.4rem !important;\n",
    "}\n",
    ".rendered_html pre code {\n",
    "    background-color: #C4E4ff;   \n",
    "    padding: 2px 25px;\n",
    "}\n",
    ".rendered_html pre {\n",
    "    background-color: #99c9ff;\n",
    "}\n",
    "div.code_cell .CodeMirror {\n",
    "    font-size: 2rem !important;\n",
    "    line-height: 3.6rem !important;\n",
    "}\n",
    ".rendered_html img, .rendered_html svg {\n",
    "    max-width: 60%;\n",
    "    height: auto;\n",
    "    float: right;\n",
    "}\n",
    "\n",
    ".rendered_html img[src*=\"#full\"], .rendered_html svg[src*=\"#full\"] {\n",
    "    max-width: 100%;\n",
    "    height: auto;\n",
    "    float: none;\n",
    "}\n",
    "\n",
    ".rendered_html img[src*=\"#thumbnail\"], .rendered_html svg[src*=\"#thumbnail\"] {\n",
    "    max-width: 15%;\n",
    "    height: auto;\n",
    "}\n",
    ".rendered_html img[src*=\"#thumbnailauto\"], .rendered_html svg[src*=\"#thumbnail\"] {\n",
    "    max-width: auto;\n",
    "    height: auto;\n",
    "}\n",
    "\n",
    "/* Gradient transparent - color - transparent */\n",
    "hr {\n",
    "    border: 0;\n",
    "    border-bottom: 1px dashed #ccc;\n",
    "}\n",
    ".emoticon{\n",
    "    font-size: 5rem;\n",
    "    line-height: 4.4rem;\n",
    "    text-align: center;\n",
    "    vertical-align: middle;\n",
    "}\n",
    ".bg-reshape {\n",
    "    width: 550px;\n",
    "    height: 205px;\n",
    "    background: url('../20春_pandas_CheatSheet.svg') -205px -110px;\n",
    "    float: left;\n",
    "}\n",
    ".break {\n",
    "                   page-break-after: right; \n",
    "                   width:100%;\n",
    "                   clear:both;\n",
    "}\n",
    "</style>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 爬取数据"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 爬取北上广深的天气质量数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import time\n",
    "import requests\n",
    "from bs4 import BeautifulSoup\n",
    "\n",
    "headers = {\n",
    "    'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36'\n",
    "}\n",
    "citys = ['beijing', 'shanghai', 'guangzhou', 'shenzhen']\n",
    "for i in range(len(citys)):\n",
    "    time.sleep(5)\n",
    "    for j in range(1, 13):\n",
    "        time.sleep(5)\n",
    "        url = 'http://www.tianqihoubao.com/aqi/' + citys[i] + '-2020' + str(\"%02d\" % j) + '.html'\n",
    "        response = requests.get(url=url, headers=headers) #请求解析url\n",
    "        soup = BeautifulSoup(response.text, 'html.parser')\n",
    "        tr = soup.find_all('tr')\n",
    "        # 解析详细页面，获取页面表格内容\n",
    "        for k in tr[1:]:\n",
    "            td = k.find_all('td')\n",
    "            Date = td[0].get_text().strip()\n",
    "            Quality_grade = td[1].get_text().strip()\n",
    "            AQI = td[2].get_text().strip()\n",
    "            AQI_rank = td[3].get_text().strip()\n",
    "            PM = td[4].get_text()\n",
    "            filename = 'air_' + citys[i] + '_2020.csv' # 保存到本地\n",
    "            with open(filename, 'a+', encoding='utf-8-sig') as f:\n",
    "                f.write(Date + ',' + Quality_grade + ',' + AQI + ',' + AQI_rank + ',' + PM + '\\n')\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 数据清洗与处理"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2020年北上广深天气质量对比"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 北京数据处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>日期</th>\n",
       "      <th>空气质量等级</th>\n",
       "      <th>AQI</th>\n",
       "      <th>AQI排名</th>\n",
       "      <th>PM</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2020-01-01</td>\n",
       "      <td>良</td>\n",
       "      <td>52</td>\n",
       "      <td>97</td>\n",
       "      <td>33</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2020-01-02</td>\n",
       "      <td>良</td>\n",
       "      <td>69</td>\n",
       "      <td>132</td>\n",
       "      <td>49</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2020-01-03</td>\n",
       "      <td>良</td>\n",
       "      <td>69</td>\n",
       "      <td>128</td>\n",
       "      <td>49</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2020-01-04</td>\n",
       "      <td>良</td>\n",
       "      <td>60</td>\n",
       "      <td>100</td>\n",
       "      <td>42</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2020-01-05</td>\n",
       "      <td>良</td>\n",
       "      <td>86</td>\n",
       "      <td>186</td>\n",
       "      <td>63</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>361</th>\n",
       "      <td>2020-12-27</td>\n",
       "      <td>良</td>\n",
       "      <td>85</td>\n",
       "      <td>129</td>\n",
       "      <td>63</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>362</th>\n",
       "      <td>2020-12-28</td>\n",
       "      <td>良</td>\n",
       "      <td>88</td>\n",
       "      <td>156</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>363</th>\n",
       "      <td>2020-12-29</td>\n",
       "      <td>优</td>\n",
       "      <td>50</td>\n",
       "      <td>139</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>364</th>\n",
       "      <td>2020-12-30</td>\n",
       "      <td>优</td>\n",
       "      <td>30</td>\n",
       "      <td>55</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>365</th>\n",
       "      <td>2020-12-31</td>\n",
       "      <td>优</td>\n",
       "      <td>34</td>\n",
       "      <td>50</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>366 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "             日期 空气质量等级  AQI  AQI排名  PM\n",
       "0    2020-01-01      良   52     97  33\n",
       "1    2020-01-02      良   69    132  49\n",
       "2    2020-01-03      良   69    128  49\n",
       "3    2020-01-04      良   60    100  42\n",
       "4    2020-01-05      良   86    186  63\n",
       "..          ...    ...  ...    ...  ..\n",
       "361  2020-12-27      良   85    129  63\n",
       "362  2020-12-28      良   88    156  60\n",
       "363  2020-12-29      优   50    139   8\n",
       "364  2020-12-30      优   30     55   5\n",
       "365  2020-12-31      优   34     50  11\n",
       "\n",
       "[366 rows x 5 columns]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 读取北京数据\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "citys = ['beijing', 'shanghai', 'guangzhou', 'shenzhen']\n",
    "for i in range(1):\n",
    "    filename = 'air_' + citys[i] + '_2020.csv'\n",
    "    df = pd.read_csv(filename, header=None, names=[\"日期\", \"空气质量等级\", \"AQI\", \"AQI排名\", \"PM\"])\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>空气质量等级</th>\n",
       "      <th>count</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>优</td>\n",
       "      <td>165</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>良</td>\n",
       "      <td>158</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>轻度污染</td>\n",
       "      <td>28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>中度污染</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>重度污染</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>严重污染</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  空气质量等级  count\n",
       "0      优    165\n",
       "1      良    158\n",
       "2   轻度污染     28\n",
       "3   中度污染      9\n",
       "4   重度污染      5\n",
       "5   严重污染      1"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 对天气质量等级进行统计并排序\n",
    "rank_message = df.groupby(['空气质量等级'])# 以空气质量等级进行分组聚合\n",
    "rank_com = rank_message['空气质量等级'].agg(['count']) #对空气质量等级数量进行统计\n",
    "rank_com.reset_index(inplace=False)\n",
    "rank_com_last = rank_com.sort_values('count', ascending=False) #以统计数量进行降序排序\n",
    "rank_com_lasts = rank_com_last.reset_index(inplace = False) # # 重新建立索引\n",
    "rank_com_lasts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[array(['优', '良', '轻度污染', '中度污染', '重度污染', '严重污染'], dtype=object)]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 创建北京空气质量等级数组\n",
    "v = []\n",
    "attrs = []\n",
    "attr = rank_com_lasts['空气质量等级']\n",
    "attr = np.array(rank_com_lasts['空气质量等级']) # 建立空气质量等级数组\n",
    "attrs.append(attr)\n",
    "attrs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[array([165, 158,  28,   9,   5,   1], dtype=int64)]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 创建count统计数组\n",
    "v1 = rank_com_lasts['count']\n",
    "v1 = np.array(rank_com_lasts['count']) # 建立统计数组\n",
    "v.append(v1)\n",
    "v"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 上海数据处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 方法同上，处理上海数据\n",
    "attrs1 = []\n",
    "s = []\n",
    "for i in range(2):\n",
    "    filename = 'air_' + citys[i] + '_2020.csv'\n",
    "    df1 = pd.read_csv(filename, header=None, names=[\"日期\", \"空气质量等级\", \"AQI\", \"AQI排名\", \"PM\"])\n",
    "\n",
    "    rank_message1 = df1.groupby(['空气质量等级'])\n",
    "    rank_com1 = rank_message1['空气质量等级'].agg(['count'])\n",
    "    rank_com_last1 = rank_com1.sort_values('count', ascending=False)\n",
    "    rank_com_lasts1 = rank_com_last1.reset_index(inplace=False)\n",
    "    rank_com_lasts1\n",
    "    \n",
    "    attr1 = rank_com_lasts1['空气质量等级']\n",
    "    attr1 = np.array(rank_com_lasts1['空气质量等级'])\n",
    "    attrs1.append(attr1)\n",
    "    s1 = rank_com_lasts1['count']\n",
    "    s1 = np.array(rank_com_lasts1['count'])\n",
    "    s.append(s1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 广州数据处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 方法同上，处理广州数据\n",
    "attrs2 = []\n",
    "b = []\n",
    "for i in range(3):\n",
    "    filename = 'air_' + citys[i] + '_2020.csv'\n",
    "    df2 = pd.read_csv(filename, header=None, names=[\"日期\", \"空气质量等级\", \"AQI\", \"AQI排名\", \"PM\"])\n",
    "\n",
    "    rank_message2 = df2.groupby(['空气质量等级'])\n",
    "    rank_com2 = rank_message2['空气质量等级'].agg(['count'])\n",
    "    rank_com_last2 = rank_com2.sort_values('count', ascending=False)\n",
    "    rank_com_lasts2 = rank_com_last2.reset_index(inplace=False)\n",
    "    rank_com_lasts2\n",
    "\n",
    "    attr2 = rank_com_lasts2['空气质量等级']\n",
    "    attr2 = np.array(rank_com_lasts2['空气质量等级'])\n",
    "    attrs2.append(attr2)\n",
    "    s2 = rank_com_lasts2['count']\n",
    "    s2 = np.array(rank_com_lasts2['count'])\n",
    "    b.append(s2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 深圳数据处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 方法同上，处理深圳数据\n",
    "attrs3 = []\n",
    "n = []\n",
    "for i in range(4):\n",
    "    filename = 'air_' + citys[i] + '_2020.csv'\n",
    "    df3 = pd.read_csv(filename, header=None, names=[\"日期\", \"空气质量等级\", \"AQI\", \"AQI排名\", \"PM\"])\n",
    "\n",
    "    rank_message3 = df3.groupby(['空气质量等级'])\n",
    "    rank_com3 = rank_message3['空气质量等级'].agg(['count'])\n",
    "    rank_com_last3 = rank_com3.sort_values('count', ascending=False)\n",
    "    rank_com_lasts3 = rank_com_last3.reset_index(inplace=False)\n",
    "    rank_com_lasts3\n",
    "\n",
    "    attr3 = rank_com_lasts3['空气质量等级']\n",
    "    attr3 = np.array(rank_com_lasts3['空气质量等级'])\n",
    "    attrs3.append(attr3)\n",
    "    s3 = rank_com_lasts3['count']\n",
    "    s3 = np.array(rank_com_lasts3['count'])\n",
    "    n.append(s3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[array(['优', '良', '轻度污染', '中度污染', '重度污染', '严重污染'], dtype=object),\n",
       " array(['优', '良', '轻度污染', '中度污染', '重度污染'], dtype=object),\n",
       " array(['优', '良', '轻度污染'], dtype=object),\n",
       " array(['优', '良'], dtype=object)]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "attrs3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[array([165, 158,  28,   9,   5,   1], dtype=int64),\n",
       " array([235, 114,  12,   4,   1], dtype=int64),\n",
       " array([257, 108,   1], dtype=int64),\n",
       " array([304,  62], dtype=int64)]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 创建Dataframe"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>城市</th>\n",
       "      <th>优</th>\n",
       "      <th>良</th>\n",
       "      <th>轻度污染</th>\n",
       "      <th>中度污染</th>\n",
       "      <th>重度污染</th>\n",
       "      <th>严重污染</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>北京</td>\n",
       "      <td>165</td>\n",
       "      <td>158</td>\n",
       "      <td>28</td>\n",
       "      <td>9</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>上海</td>\n",
       "      <td>235</td>\n",
       "      <td>114</td>\n",
       "      <td>12</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>广州</td>\n",
       "      <td>257</td>\n",
       "      <td>108</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>深圳</td>\n",
       "      <td>304</td>\n",
       "      <td>62</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   城市    优    良 轻度污染 中度污染 重度污染 严重污染\n",
       "0  北京  165  158   28    9    5    1\n",
       "1  上海  235  114   12    4    1    0\n",
       "2  广州  257  108    1    0    0    0\n",
       "3  深圳  304   62    0    0    0    0"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 创建北上广深天气质量Datafeme，方便展示对比\n",
    "tianqi_dict = { '城市':['北京','上海','广州','深圳'],\n",
    "               '优': ['165', '235','257', '304'],\n",
    "               '良': ['158', '114', '108', '62'],\n",
    "               '轻度污染':['28','12','1','0'],\n",
    "               '中度污染':['9','4','0','0'],\n",
    "               '重度污染':['5','1','0','0'],\n",
    "               '严重污染':['1','0','0','0']\n",
    "              }\n",
    "pd.DataFrame(tianqi_dict)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 创建北上广深全年空气质量情况饼图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"a23db57c7613448cae4ea9b0cc0088db\" style=\"width:1200px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_a23db57c7613448cae4ea9b0cc0088db = echarts.init(document.getElementById('a23db57c7613448cae4ea9b0cc0088db'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_a23db57c7613448cae4ea9b0cc0088db = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"2020\\u5e74\\u5317\\u4e0a\\u5e7f\\u6df1\\u5168\\u5e74\\u7a7a\\u6c14\\u8d28\\u91cf\\u60c5\\u51b5\",\n",
       "            \"left\": \"32%\",\n",
       "            \"top\": \"0\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"text\": \"\\u5317\\u4eac\",\n",
       "            \"left\": \"28%\",\n",
       "            \"top\": \"24%\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"text\": \"\\u4e0a\\u6d77\",\n",
       "            \"left\": \"58%\",\n",
       "            \"top\": \"24%\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"text\": \"\\u5e7f\\u5dde\",\n",
       "            \"left\": \"28%\",\n",
       "            \"top\": \"77%\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"text\": \"\\u6df1\\u5733\",\n",
       "            \"left\": \"58%\",\n",
       "            \"top\": \"77%\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 4956810,\n",
       "    \"tooltip\": {},\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u4f18\",\n",
       "                    \"value\": 165.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u826f\",\n",
       "                    \"value\": 158.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8f7b\\u5ea6\\u6c61\\u67d3\",\n",
       "                    \"value\": 28.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e2d\\u5ea6\\u6c61\\u67d3\",\n",
       "                    \"value\": 9.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91cd\\u5ea6\\u6c61\\u67d3\",\n",
       "                    \"value\": 5.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e25\\u91cd\\u6c61\\u67d3\",\n",
       "                    \"value\": 1.0\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"25%\",\n",
       "                \"40%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"30%\",\n",
       "                \"27%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"outside\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{b}: {d}%\"\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{b}: {d}%\"\n",
       "                }\n",
       "            },\n",
       "            \"seriesId\": 6148373\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u4f18\",\n",
       "                    \"value\": 235.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u826f\",\n",
       "                    \"value\": 114.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8f7b\\u5ea6\\u6c61\\u67d3\",\n",
       "                    \"value\": 12.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e2d\\u5ea6\\u6c61\\u67d3\",\n",
       "                    \"value\": 4.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91cd\\u5ea6\\u6c61\\u67d3\",\n",
       "                    \"value\": 1.0\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"25%\",\n",
       "                \"40%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"60%\",\n",
       "                \"27%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"outside\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{b}: {d}%\"\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{b}: {d}%\"\n",
       "                }\n",
       "            },\n",
       "            \"seriesId\": 3876963\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u4f18\",\n",
       "                    \"value\": 257.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u826f\",\n",
       "                    \"value\": 108.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8f7b\\u5ea6\\u6c61\\u67d3\",\n",
       "                    \"value\": 1.0\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"25%\",\n",
       "                \"40%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"30%\",\n",
       "                \"80%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"outside\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{b}: {d}%\"\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{b}: {d}%\"\n",
       "                }\n",
       "            },\n",
       "            \"seriesId\": 8502723\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u4f18\",\n",
       "                    \"value\": 304.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u826f\",\n",
       "                    \"value\": 62.0\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"25%\",\n",
       "                \"40%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"60%\",\n",
       "                \"80%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"outside\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{b}: {d}%\"\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{b}: {d}%\"\n",
       "                }\n",
       "            },\n",
       "            \"seriesId\": 3965042\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": []\n",
       "        },\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u4f18\",\n",
       "                \"\\u826f\",\n",
       "                \"\\u8f7b\\u5ea6\\u6c61\\u67d3\",\n",
       "                \"\\u4e2d\\u5ea6\\u6c61\\u67d3\",\n",
       "                \"\\u91cd\\u5ea6\\u6c61\\u67d3\",\n",
       "                \"\\u4e25\\u91cd\\u6c61\\u67d3\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"27%\",\n",
       "            \"top\": \"51%\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u4f18\",\n",
       "                \"\\u826f\",\n",
       "                \"\\u8f7b\\u5ea6\\u6c61\\u67d3\",\n",
       "                \"\\u4e2d\\u5ea6\\u6c61\\u67d3\",\n",
       "                \"\\u91cd\\u5ea6\\u6c61\\u67d3\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": false,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u4f18\",\n",
       "                \"\\u826f\",\n",
       "                \"\\u8f7b\\u5ea6\\u6c61\\u67d3\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": false,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u4f18\",\n",
       "                \"\\u826f\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": false,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"grid\": [\n",
       "        {},\n",
       "        {},\n",
       "        {},\n",
       "        {}\n",
       "    ]\n",
       "};\n",
       "myChart_a23db57c7613448cae4ea9b0cc0088db.setOption(option_a23db57c7613448cae4ea9b0cc0088db);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.custom.grid.Grid at 0x2577ce03eb0>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 创建北上广深全年空气质量情况饼图\n",
    "from pyecharts import Pie, Grid\n",
    "pie = Pie('2020年北上广深全年空气质量情况',title_pos='32%', title_top='0', width=800, height=400)\n",
    "pie1 = Pie(\"北京\", title_pos=\"28%\", title_top=\"24%\")\n",
    "pie1.add(\"\", attrs[0], v[0], radius=[25, 40], center=[30, 27], legend_pos=\"27%\", legend_top=\"51%\", legend_orient=\"horizontal\",)\n",
    "pie2 = Pie(\"上海\", title_pos=\"58%\", title_top=\"24%\")\n",
    "pie2.add(\"\", attrs1[1], s[1], radius=[25, 40], center=[60, 27], is_label_show=False, is_legend_show=False)\n",
    "pie3 = Pie(\"广州\", title_pos='28%', title_top='77%')\n",
    "pie3.add(\"\", attrs2[2], b[2], radius=[25, 40], center=[30, 80], is_label_show=False, is_legend_show=False)\n",
    "pie4 = Pie(\"深圳\", title_pos='58%', title_top='77%')\n",
    "pie4.add(\"\", attrs3[3], n[3], radius=[25, 40], center=[60, 80], is_label_show=False, is_legend_show=False)\n",
    "# 叠加\n",
    "grid = Grid(\"2020年北上广深全年空气质量情况\", width=1200)\n",
    "grid.add(pie)\n",
    "grid.add(pie1)\n",
    "grid.add(pie2)\n",
    "grid.add(pie3)\n",
    "grid.add(pie4)\n",
    "# grid.render('2020年北上广深全年空气质量情况.html')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2020年北上广深AQI全年走势图"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 北京数据处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>日期</th>\n",
       "      <th>AQI</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2020-01-01</td>\n",
       "      <td>52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2020-01-02</td>\n",
       "      <td>69</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2020-01-03</td>\n",
       "      <td>69</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2020-01-04</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2020-01-05</td>\n",
       "      <td>86</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>361</th>\n",
       "      <td>2020-12-27</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>362</th>\n",
       "      <td>2020-12-28</td>\n",
       "      <td>88</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>363</th>\n",
       "      <td>2020-12-29</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>364</th>\n",
       "      <td>2020-12-30</td>\n",
       "      <td>30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>365</th>\n",
       "      <td>2020-12-31</td>\n",
       "      <td>34</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>366 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "             日期  AQI\n",
       "0    2020-01-01   52\n",
       "1    2020-01-02   69\n",
       "2    2020-01-03   69\n",
       "3    2020-01-04   60\n",
       "4    2020-01-05   86\n",
       "..          ...  ...\n",
       "361  2020-12-27   85\n",
       "362  2020-12-28   88\n",
       "363  2020-12-29   50\n",
       "364  2020-12-30   30\n",
       "365  2020-12-31   34\n",
       "\n",
       "[366 rows x 2 columns]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 提取北京数据中的日期和AQI列\n",
    "from pyecharts import Line\n",
    "dom = df[['日期', 'AQI']]\n",
    "dom"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>日期</th>\n",
       "      <th>空气质量等级</th>\n",
       "      <th>AQI</th>\n",
       "      <th>AQI排名</th>\n",
       "      <th>PM</th>\n",
       "      <th>月</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2020-01-01</td>\n",
       "      <td>良</td>\n",
       "      <td>52</td>\n",
       "      <td>97</td>\n",
       "      <td>33</td>\n",
       "      <td>01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2020-01-02</td>\n",
       "      <td>良</td>\n",
       "      <td>69</td>\n",
       "      <td>132</td>\n",
       "      <td>49</td>\n",
       "      <td>01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2020-01-03</td>\n",
       "      <td>良</td>\n",
       "      <td>69</td>\n",
       "      <td>128</td>\n",
       "      <td>49</td>\n",
       "      <td>01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2020-01-04</td>\n",
       "      <td>良</td>\n",
       "      <td>60</td>\n",
       "      <td>100</td>\n",
       "      <td>42</td>\n",
       "      <td>01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2020-01-05</td>\n",
       "      <td>良</td>\n",
       "      <td>86</td>\n",
       "      <td>186</td>\n",
       "      <td>63</td>\n",
       "      <td>01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>361</th>\n",
       "      <td>2020-12-27</td>\n",
       "      <td>良</td>\n",
       "      <td>85</td>\n",
       "      <td>129</td>\n",
       "      <td>63</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>362</th>\n",
       "      <td>2020-12-28</td>\n",
       "      <td>良</td>\n",
       "      <td>88</td>\n",
       "      <td>156</td>\n",
       "      <td>60</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>363</th>\n",
       "      <td>2020-12-29</td>\n",
       "      <td>优</td>\n",
       "      <td>50</td>\n",
       "      <td>139</td>\n",
       "      <td>8</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>364</th>\n",
       "      <td>2020-12-30</td>\n",
       "      <td>优</td>\n",
       "      <td>30</td>\n",
       "      <td>55</td>\n",
       "      <td>5</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>365</th>\n",
       "      <td>2020-12-31</td>\n",
       "      <td>优</td>\n",
       "      <td>34</td>\n",
       "      <td>50</td>\n",
       "      <td>11</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>366 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "             日期 空气质量等级  AQI  AQI排名  PM   月\n",
       "0    2020-01-01      良   52     97  33  01\n",
       "1    2020-01-02      良   69    132  49  01\n",
       "2    2020-01-03      良   69    128  49  01\n",
       "3    2020-01-04      良   60    100  42  01\n",
       "4    2020-01-05      良   86    186  63  01\n",
       "..          ...    ...  ...    ...  ..  ..\n",
       "361  2020-12-27      良   85    129  63  12\n",
       "362  2020-12-28      良   88    156  60  12\n",
       "363  2020-12-29      优   50    139   8  12\n",
       "364  2020-12-30      优   30     55   5  12\n",
       "365  2020-12-31      优   34     50  11  12\n",
       "\n",
       "[366 rows x 6 columns]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 对日期列进行处理\n",
    "list1 = []\n",
    "for j in dom['日期']:\n",
    "    time = j.split('-')[1] # 删除-，提取月份\n",
    "    list1.append(time)\n",
    "df['月'] = list1 # 添加月份列\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>月</th>\n",
       "      <th>mean</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>01</td>\n",
       "      <td>80.677419</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>02</td>\n",
       "      <td>85.275862</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>03</td>\n",
       "      <td>59.580645</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>04</td>\n",
       "      <td>59.066667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>05</td>\n",
       "      <td>65.903226</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>06</td>\n",
       "      <td>67.766667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>07</td>\n",
       "      <td>65.225806</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>08</td>\n",
       "      <td>49.096774</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>09</td>\n",
       "      <td>41.200000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>10</td>\n",
       "      <td>69.806452</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>11</td>\n",
       "      <td>60.900000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>12</td>\n",
       "      <td>50.193548</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     月       mean\n",
       "0   01  80.677419\n",
       "1   02  85.275862\n",
       "2   03  59.580645\n",
       "3   04  59.066667\n",
       "4   05  65.903226\n",
       "5   06  67.766667\n",
       "6   07  65.225806\n",
       "7   08  49.096774\n",
       "8   09  41.200000\n",
       "9   10  69.806452\n",
       "10  11  60.900000\n",
       "11  12  50.193548"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "month_message = df.groupby(['月'])# 以月份进行聚合\n",
    "month_com = month_message['AQI'].agg(['mean']) # 对AQI进行平均数计算\n",
    "month_com.reset_index(inplace=True) # 重新建立索引\n",
    "month_com_last = month_com.sort_index() #  # 排序\n",
    "month_com_last"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[['80', '85', '59', '59', '65', '67', '65', '49', '41', '69', '60', '50']]"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "v = []\n",
    "v1 = np.array(month_com_last['mean']) # 创建平均数的数组\n",
    "v1 = [\"{}\".format(int(i)) for i in v1]\n",
    "v.append(v1)\n",
    "v"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "attr = [\"{}\".format(str(i) + '月') for i in range(1, 13)] # 创建月的数组\n",
    "attr"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 上海数据处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[['80', '85', '59', '59', '65', '67', '65', '49', '41', '69', '60', '50'],\n",
       " ['72', '47', '45', '54', '62', '45', '42', '36', '44', '38', '45', '67']]"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 提取上海数据中的日期和AQI列\n",
    "from pyecharts import Line\n",
    "dom1 = df1[['日期', 'AQI']]\n",
    "# 对日期列进行处理\n",
    "list2 = []\n",
    "for j in dom1['日期']:\n",
    "    time1 = j.split('-')[1] # 删除-，提取月份\n",
    "    list2.append(time1)\n",
    "df1['月'] = list2 # 添加月份列\n",
    "month_message1 = df1.groupby(['月'])# 以月份进行聚合\n",
    "month_com1 = month_message1['AQI'].agg(['mean']) # 对AQI进行平均数计算\n",
    "month_com1.reset_index(inplace=True) # 重新建立索引\n",
    "month_com_last1 = month_com1.sort_index() #  # 排序\n",
    "v2 = np.array(month_com_last1['mean']) # 创建平均数的数组\n",
    "v2 = [\"{}\".format(int(i)) for i in v2]\n",
    "v.append(v2)\n",
    "v"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 广州数据处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[['80', '85', '59', '59', '65', '67', '65', '49', '41', '69', '60', '50'],\n",
       " ['72', '47', '45', '54', '62', '45', '42', '36', '44', '38', '45', '67'],\n",
       " ['47', '37', '38', '49', '37', '27', '30', '36', '39', '46', '54', '54']]"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 提取广州数据中的日期和AQI列\n",
    "from pyecharts import Line\n",
    "dom2 = df2[['日期', 'AQI']]\n",
    "# 对日期列进行处理\n",
    "list3 = []\n",
    "for j in dom2['日期']:\n",
    "    time2 = j.split('-')[1] # 删除-，提取月份\n",
    "    list3.append(time2)\n",
    "df2['月'] = list3 # 添加月份列\n",
    "month_message2 = df2.groupby(['月'])# 以月份进行聚合\n",
    "month_com2 = month_message2['AQI'].agg(['mean']) # 对AQI进行平均数计算\n",
    "month_com2.reset_index(inplace=True) # 重新建立索引\n",
    "month_com_last2 = month_com2.sort_index() #  # 排序\n",
    "v3 = np.array(month_com_last2['mean']) # 创建平均数的数组\n",
    "v3 = [\"{}\".format(int(i)) for i in v3]\n",
    "v.append(v3)\n",
    "v"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 深圳数据处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[['80', '85', '59', '59', '65', '67', '65', '49', '41', '69', '60', '50'],\n",
       " ['72', '47', '45', '54', '62', '45', '42', '36', '44', '38', '45', '67'],\n",
       " ['47', '37', '38', '49', '37', '27', '30', '36', '39', '46', '54', '54'],\n",
       " ['42', '31', '36', '39', '26', '15', '16', '24', '29', '43', '47', '54']]"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 提取深圳数据中的日期和AQI列\n",
    "from pyecharts import Line\n",
    "dom3 = df3[['日期', 'AQI']]\n",
    "# 对日期列进行处理\n",
    "list4 = []\n",
    "for j in dom3['日期']:\n",
    "    time3 = j.split('-')[1] # 删除-，提取月份\n",
    "    list4.append(time3)\n",
    "df3['月'] = list4 # 添加月份列\n",
    "month_message3 = df3.groupby(['月'])# 以月份进行聚合\n",
    "month_com3 = month_message3['AQI'].agg(['mean']) # 对AQI进行平均数计算\n",
    "month_com3.reset_index(inplace=True) # 重新建立索引\n",
    "month_com_last3 = month_com3.sort_index() #  # 排序\n",
    "v4 = np.array(month_com_last3['mean']) # 创建平均数的数组\n",
    "v4 = [\"{}\".format(int(i)) for i in v4]\n",
    "v.append(v4)\n",
    "v"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 创建Dataframe"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>城市</th>\n",
       "      <th>1月</th>\n",
       "      <th>2月</th>\n",
       "      <th>3月</th>\n",
       "      <th>4月</th>\n",
       "      <th>5月</th>\n",
       "      <th>6月</th>\n",
       "      <th>7月</th>\n",
       "      <th>8月</th>\n",
       "      <th>9月</th>\n",
       "      <th>10月</th>\n",
       "      <th>11月</th>\n",
       "      <th>12月</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>北京</td>\n",
       "      <td>80</td>\n",
       "      <td>85</td>\n",
       "      <td>59</td>\n",
       "      <td>59</td>\n",
       "      <td>65</td>\n",
       "      <td>67</td>\n",
       "      <td>65</td>\n",
       "      <td>49</td>\n",
       "      <td>41</td>\n",
       "      <td>69</td>\n",
       "      <td>60</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>上海</td>\n",
       "      <td>72</td>\n",
       "      <td>47</td>\n",
       "      <td>45</td>\n",
       "      <td>54</td>\n",
       "      <td>62</td>\n",
       "      <td>45</td>\n",
       "      <td>42</td>\n",
       "      <td>36</td>\n",
       "      <td>44</td>\n",
       "      <td>38</td>\n",
       "      <td>45</td>\n",
       "      <td>67</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>广州</td>\n",
       "      <td>47</td>\n",
       "      <td>37</td>\n",
       "      <td>38</td>\n",
       "      <td>49</td>\n",
       "      <td>37</td>\n",
       "      <td>27</td>\n",
       "      <td>30</td>\n",
       "      <td>36</td>\n",
       "      <td>39</td>\n",
       "      <td>46</td>\n",
       "      <td>54</td>\n",
       "      <td>54</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>深圳</td>\n",
       "      <td>42</td>\n",
       "      <td>31</td>\n",
       "      <td>36</td>\n",
       "      <td>39</td>\n",
       "      <td>26</td>\n",
       "      <td>15</td>\n",
       "      <td>16</td>\n",
       "      <td>24</td>\n",
       "      <td>29</td>\n",
       "      <td>43</td>\n",
       "      <td>47</td>\n",
       "      <td>54</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   城市  1月  2月  3月  4月  5月  6月  7月  8月  9月 10月 11月 12月\n",
       "0  北京  80  85  59  59  65  67  65  49  41  69  60  50\n",
       "1  上海  72  47  45  54  62  45  42  36  44  38  45  67\n",
       "2  广州  47  37  38  49  37  27  30  36  39  46  54  54\n",
       "3  深圳  42  31  36  39  26  15  16  24  29  43  47  54"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data01=pd.DataFrame(v) # numpy转换为Dataframe\n",
    "data01['城市'] = ['北京','上海','广州','深圳'] #新建一列城市\n",
    "mid = data01['城市']        \n",
    "data01.drop(labels=['城市'], axis=1,inplace = True)     # 删除城市列\n",
    "data01.insert(0, '城市', mid) # 以第一列方式插入\n",
    "data01.columns=['城市','1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']  # 直接更改列名\n",
    "data01"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 创建2020年北上广深AQI全年走势折现图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"8800b5c33e6b4e39b986991ada6a244c\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_8800b5c33e6b4e39b986991ada6a244c = echarts.init(document.getElementById('8800b5c33e6b4e39b986991ada6a244c'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_8800b5c33e6b4e39b986991ada6a244c = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"2020\\u5e74\\u5317\\u4e0a\\u5e7f\\u6df1AQI\\u5168\\u5e74\\u8d70\\u52bf\\u56fe\",\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"0\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 7972774,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5317\\u4eac\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u6708\",\n",
       "                    \"80\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u6708\",\n",
       "                    \"85\"\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u6708\",\n",
       "                    \"59\"\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u6708\",\n",
       "                    \"59\"\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u6708\",\n",
       "                    \"65\"\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u6708\",\n",
       "                    \"67\"\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u6708\",\n",
       "                    \"65\"\n",
       "                ],\n",
       "                [\n",
       "                    \"8\\u6708\",\n",
       "                    \"49\"\n",
       "                ],\n",
       "                [\n",
       "                    \"9\\u6708\",\n",
       "                    \"41\"\n",
       "                ],\n",
       "                [\n",
       "                    \"10\\u6708\",\n",
       "                    \"69\"\n",
       "                ],\n",
       "                [\n",
       "                    \"11\\u6708\",\n",
       "                    \"60\"\n",
       "                ],\n",
       "                [\n",
       "                    \"12\\u6708\",\n",
       "                    \"50\"\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"color\": \"red\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 7972774\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u4e0a\\u6d77\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u6708\",\n",
       "                    \"72\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u6708\",\n",
       "                    \"47\"\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u6708\",\n",
       "                    \"45\"\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u6708\",\n",
       "                    \"54\"\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u6708\",\n",
       "                    \"62\"\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u6708\",\n",
       "                    \"45\"\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u6708\",\n",
       "                    \"42\"\n",
       "                ],\n",
       "                [\n",
       "                    \"8\\u6708\",\n",
       "                    \"36\"\n",
       "                ],\n",
       "                [\n",
       "                    \"9\\u6708\",\n",
       "                    \"44\"\n",
       "                ],\n",
       "                [\n",
       "                    \"10\\u6708\",\n",
       "                    \"38\"\n",
       "                ],\n",
       "                [\n",
       "                    \"11\\u6708\",\n",
       "                    \"45\"\n",
       "                ],\n",
       "                [\n",
       "                    \"12\\u6708\",\n",
       "                    \"67\"\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"color\": \"purple\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 7972774\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5e7f\\u5dde\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u6708\",\n",
       "                    \"47\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u6708\",\n",
       "                    \"37\"\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u6708\",\n",
       "                    \"38\"\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u6708\",\n",
       "                    \"49\"\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u6708\",\n",
       "                    \"37\"\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u6708\",\n",
       "                    \"27\"\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u6708\",\n",
       "                    \"30\"\n",
       "                ],\n",
       "                [\n",
       "                    \"8\\u6708\",\n",
       "                    \"36\"\n",
       "                ],\n",
       "                [\n",
       "                    \"9\\u6708\",\n",
       "                    \"39\"\n",
       "                ],\n",
       "                [\n",
       "                    \"10\\u6708\",\n",
       "                    \"46\"\n",
       "                ],\n",
       "                [\n",
       "                    \"11\\u6708\",\n",
       "                    \"54\"\n",
       "                ],\n",
       "                [\n",
       "                    \"12\\u6708\",\n",
       "                    \"54\"\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"color\": \"blue\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 7972774\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u6df1\\u5733\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u6708\",\n",
       "                    \"42\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u6708\",\n",
       "                    \"31\"\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u6708\",\n",
       "                    \"36\"\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u6708\",\n",
       "                    \"39\"\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u6708\",\n",
       "                    \"26\"\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u6708\",\n",
       "                    \"15\"\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u6708\",\n",
       "                    \"16\"\n",
       "                ],\n",
       "                [\n",
       "                    \"8\\u6708\",\n",
       "                    \"24\"\n",
       "                ],\n",
       "                [\n",
       "                    \"9\\u6708\",\n",
       "                    \"29\"\n",
       "                ],\n",
       "                [\n",
       "                    \"10\\u6708\",\n",
       "                    \"43\"\n",
       "                ],\n",
       "                [\n",
       "                    \"11\\u6708\",\n",
       "                    \"47\"\n",
       "                ],\n",
       "                [\n",
       "                    \"12\\u6708\",\n",
       "                    \"54\"\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"color\": \"orange\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 7972774\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5317\\u4eac\",\n",
       "                \"\\u4e0a\\u6d77\",\n",
       "                \"\\u5e7f\\u5dde\",\n",
       "                \"\\u6df1\\u5733\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"8%\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"category\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"1\\u6708\",\n",
       "                \"2\\u6708\",\n",
       "                \"3\\u6708\",\n",
       "                \"4\\u6708\",\n",
       "                \"5\\u6708\",\n",
       "                \"6\\u6708\",\n",
       "                \"7\\u6708\",\n",
       "                \"8\\u6708\",\n",
       "                \"9\\u6708\",\n",
       "                \"10\\u6708\",\n",
       "                \"11\\u6708\",\n",
       "                \"12\\u6708\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ]\n",
       "};\n",
       "myChart_8800b5c33e6b4e39b986991ada6a244c.setOption(option_8800b5c33e6b4e39b986991ada6a244c);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.line.Line at 0x2577cfb8940>"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 创建2020年北上广深AQI全年走势折现图\n",
    "line = Line(\"2020年北上广深AQI全年走势图\", title_pos='center', title_top='0', width=800, height=400)\n",
    "line.add(\"北京\", attr, v[0], line_color='red', legend_top='8%')\n",
    "line.add(\"上海\", attr, v[1], line_color='purple', legend_top='8%')\n",
    "line.add(\"广州\", attr, v[2], line_color='blue', legend_top='8%')\n",
    "line.add(\"深圳\", attr, v[3], line_color='orange', legend_top='8%')\n",
    "# line.render('2020年北上广深AQI全年走势图.html')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2020年北上广深PM2.5全年走势图"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 北京数据处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[['58', '61', '34', '30', '35', '31', '40', '28', '23', '41', '36', '27']]"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "from pyecharts import Line\n",
    "# 提取北京数据中的日期和PM2.5列\n",
    "from pyecharts import Line\n",
    "dom = df[['日期', 'PM']]\n",
    "# 对日期列进行处理\n",
    "list1 = []\n",
    "for j in dom['日期']:\n",
    "    time = j.split('-')[1] # 删除-，提取月份\n",
    "    list1.append(time)\n",
    "df['月'] = list1 # 添加月份列\n",
    "month_message = df.groupby(['月'])# 以月份进行分组聚合\n",
    "month_com = month_message['PM'].agg(['mean']) # 对AOI进行平均数计算\n",
    "month_com.reset_index(inplace=True) # 重新建立索引\n",
    "month_com_last = month_com.sort_index() #  # 排序\n",
    "s = []\n",
    "s2 = np.array(month_com_last['mean']) # 创建平均数的数组\n",
    "s2 = [\"{}\".format(int(i)) for i in s2]\n",
    "s.append(s2)\n",
    "s"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 上海数据处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[['58', '61', '34', '30', '35', '31', '40', '28', '23', '41', '36', '27'],\n",
       " ['52', '32', '26', '32', '38', '29', '26', '19', '24', '18', '25', '46']]"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 提取上海数据中的日期和AOI列\n",
    "from pyecharts import Line\n",
    "dom1 = df1[['日期', 'PM']]\n",
    "# 对日期列进行处理\n",
    "list2 = []\n",
    "for j in dom1['日期']:\n",
    "    time1 = j.split('-')[1] # 删除-，提取月份\n",
    "    list2.append(time1)\n",
    "df1['月'] = list2 # 添加月份列\n",
    "month_message1 = df1.groupby(['月'])# 以月份进行聚合\n",
    "month_com1 = month_message1['PM'].agg(['mean']) # 对AOI进行平均数计算\n",
    "month_com1.reset_index(inplace=True) # 重新建立索引\n",
    "month_com_last1 = month_com1.sort_index() #  # 排序\n",
    "s2 = np.array(month_com_last1['mean']) # 创建平均数的数组\n",
    "s2 = [\"{}\".format(int(i)) for i in s2]\n",
    "s.append(s2)\n",
    "s"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 广州数据处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[['58', '61', '34', '30', '35', '31', '40', '28', '23', '41', '36', '27'],\n",
       " ['52', '32', '26', '32', '38', '29', '26', '19', '24', '18', '25', '46'],\n",
       " ['28', '23', '20', '26', '17', '11', '11', '17', '20', '26', '31', '34']]"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 提取广州数据中的日期和AOI列\n",
    "from pyecharts import Line\n",
    "dom2 = df2[['日期', 'PM']]\n",
    "# 对日期列进行处理\n",
    "list3 = []\n",
    "for j in dom2['日期']:\n",
    "    time2 = j.split('-')[1] # 删除-，提取月份\n",
    "    list3.append(time2)\n",
    "df2['月'] = list3 # 添加月份列\n",
    "month_message2 = df2.groupby(['月'])# 以月份进行聚合\n",
    "month_com2 = month_message2['PM'].agg(['mean']) # 对AOI进行平均数计算\n",
    "month_com2.reset_index(inplace=True) # 重新建立索引\n",
    "month_com_last2 = month_com2.sort_index() #  # 排序\n",
    "s3 = np.array(month_com_last2['mean']) # 创建平均数的数组\n",
    "s3 = [\"{}\".format(int(i)) for i in s3]\n",
    "s.append(s3)\n",
    "s"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 深圳数据处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[['58', '61', '34', '30', '35', '31', '40', '28', '23', '41', '36', '27'],\n",
       " ['52', '32', '26', '32', '38', '29', '26', '19', '24', '18', '25', '46'],\n",
       " ['28', '23', '20', '26', '17', '11', '11', '17', '20', '26', '31', '34'],\n",
       " ['42', '31', '36', '39', '26', '15', '16', '24', '29', '43', '47', '54']]"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 提取深圳数据中的日期和AOI列\n",
    "from pyecharts import Line\n",
    "dom3 = df3[['日期', 'AQI']]\n",
    "# 对日期列进行处理\n",
    "list4 = []\n",
    "for j in dom3['日期']:\n",
    "    time3 = j.split('-')[1] # 删除-，提取月份\n",
    "    list4.append(time3)\n",
    "df3['月'] = list4 # 添加月份列\n",
    "month_message3 = df3.groupby(['月'])# 以月份进行聚合\n",
    "month_com3 = month_message3['AQI'].agg(['mean']) # 对AOI进行平均数计算\n",
    "month_com3.reset_index(inplace=True) # 重新建立索引\n",
    "month_com_last3 = month_com3.sort_index() #  # 排序\n",
    "s4 = np.array(month_com_last3['mean']) # 创建平均数的数组\n",
    "s4 = [\"{}\".format(int(i)) for i in s4]\n",
    "s.append(s4)\n",
    "s"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 创建Dataframe\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>城市</th>\n",
       "      <th>1月</th>\n",
       "      <th>2月</th>\n",
       "      <th>3月</th>\n",
       "      <th>4月</th>\n",
       "      <th>5月</th>\n",
       "      <th>6月</th>\n",
       "      <th>7月</th>\n",
       "      <th>8月</th>\n",
       "      <th>9月</th>\n",
       "      <th>10月</th>\n",
       "      <th>11月</th>\n",
       "      <th>12月</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>北京</td>\n",
       "      <td>58</td>\n",
       "      <td>61</td>\n",
       "      <td>34</td>\n",
       "      <td>30</td>\n",
       "      <td>35</td>\n",
       "      <td>31</td>\n",
       "      <td>40</td>\n",
       "      <td>28</td>\n",
       "      <td>23</td>\n",
       "      <td>41</td>\n",
       "      <td>36</td>\n",
       "      <td>27</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>上海</td>\n",
       "      <td>52</td>\n",
       "      <td>32</td>\n",
       "      <td>26</td>\n",
       "      <td>32</td>\n",
       "      <td>38</td>\n",
       "      <td>29</td>\n",
       "      <td>26</td>\n",
       "      <td>19</td>\n",
       "      <td>24</td>\n",
       "      <td>18</td>\n",
       "      <td>25</td>\n",
       "      <td>46</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>广州</td>\n",
       "      <td>28</td>\n",
       "      <td>23</td>\n",
       "      <td>20</td>\n",
       "      <td>26</td>\n",
       "      <td>17</td>\n",
       "      <td>11</td>\n",
       "      <td>11</td>\n",
       "      <td>17</td>\n",
       "      <td>20</td>\n",
       "      <td>26</td>\n",
       "      <td>31</td>\n",
       "      <td>34</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>深圳</td>\n",
       "      <td>42</td>\n",
       "      <td>31</td>\n",
       "      <td>36</td>\n",
       "      <td>39</td>\n",
       "      <td>26</td>\n",
       "      <td>15</td>\n",
       "      <td>16</td>\n",
       "      <td>24</td>\n",
       "      <td>29</td>\n",
       "      <td>43</td>\n",
       "      <td>47</td>\n",
       "      <td>54</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   城市  1月  2月  3月  4月  5月  6月  7月  8月  9月 10月 11月 12月\n",
       "0  北京  58  61  34  30  35  31  40  28  23  41  36  27\n",
       "1  上海  52  32  26  32  38  29  26  19  24  18  25  46\n",
       "2  广州  28  23  20  26  17  11  11  17  20  26  31  34\n",
       "3  深圳  42  31  36  39  26  15  16  24  29  43  47  54"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data02=pd.DataFrame(s)  # numpy转换为Dataframe\n",
    "data02['城市'] = ['北京','上海','广州','深圳']  #新建一列城市\n",
    "mid = data02['城市']\n",
    "data02.drop(labels=['城市'], axis=1,inplace = True)  # 删除城市列\n",
    "data02.insert(0, '城市', mid)  # 以第一列方式插入\n",
    "data02.columns=['城市','1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']  # 直接更改列名\n",
    "data02"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 创建2020年北上广深PM2.5全年走势折线图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"60c99b13f772455fa93d1587669968b3\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_60c99b13f772455fa93d1587669968b3 = echarts.init(document.getElementById('60c99b13f772455fa93d1587669968b3'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_60c99b13f772455fa93d1587669968b3 = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"2020\\u5e74\\u5317\\u4e0a\\u5e7f\\u6df1PM2.5\\u5168\\u5e74\\u8d70\\u52bf\\u56fe\",\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"0\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 983198,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5317\\u4eac\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u6708\",\n",
       "                    \"58\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u6708\",\n",
       "                    \"61\"\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u6708\",\n",
       "                    \"34\"\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u6708\",\n",
       "                    \"30\"\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u6708\",\n",
       "                    \"35\"\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u6708\",\n",
       "                    \"31\"\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u6708\",\n",
       "                    \"40\"\n",
       "                ],\n",
       "                [\n",
       "                    \"8\\u6708\",\n",
       "                    \"28\"\n",
       "                ],\n",
       "                [\n",
       "                    \"9\\u6708\",\n",
       "                    \"23\"\n",
       "                ],\n",
       "                [\n",
       "                    \"10\\u6708\",\n",
       "                    \"41\"\n",
       "                ],\n",
       "                [\n",
       "                    \"11\\u6708\",\n",
       "                    \"36\"\n",
       "                ],\n",
       "                [\n",
       "                    \"12\\u6708\",\n",
       "                    \"27\"\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"color\": \"red\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 983198\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u4e0a\\u6d77\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u6708\",\n",
       "                    \"52\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u6708\",\n",
       "                    \"32\"\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u6708\",\n",
       "                    \"26\"\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u6708\",\n",
       "                    \"32\"\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u6708\",\n",
       "                    \"38\"\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u6708\",\n",
       "                    \"29\"\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u6708\",\n",
       "                    \"26\"\n",
       "                ],\n",
       "                [\n",
       "                    \"8\\u6708\",\n",
       "                    \"19\"\n",
       "                ],\n",
       "                [\n",
       "                    \"9\\u6708\",\n",
       "                    \"24\"\n",
       "                ],\n",
       "                [\n",
       "                    \"10\\u6708\",\n",
       "                    \"18\"\n",
       "                ],\n",
       "                [\n",
       "                    \"11\\u6708\",\n",
       "                    \"25\"\n",
       "                ],\n",
       "                [\n",
       "                    \"12\\u6708\",\n",
       "                    \"46\"\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"color\": \"purple\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 983198\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5e7f\\u5dde\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u6708\",\n",
       "                    \"28\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u6708\",\n",
       "                    \"23\"\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u6708\",\n",
       "                    \"20\"\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u6708\",\n",
       "                    \"26\"\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u6708\",\n",
       "                    \"17\"\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u6708\",\n",
       "                    \"11\"\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u6708\",\n",
       "                    \"11\"\n",
       "                ],\n",
       "                [\n",
       "                    \"8\\u6708\",\n",
       "                    \"17\"\n",
       "                ],\n",
       "                [\n",
       "                    \"9\\u6708\",\n",
       "                    \"20\"\n",
       "                ],\n",
       "                [\n",
       "                    \"10\\u6708\",\n",
       "                    \"26\"\n",
       "                ],\n",
       "                [\n",
       "                    \"11\\u6708\",\n",
       "                    \"31\"\n",
       "                ],\n",
       "                [\n",
       "                    \"12\\u6708\",\n",
       "                    \"34\"\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"color\": \"blue\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 983198\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u6df1\\u5733\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u6708\",\n",
       "                    \"42\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u6708\",\n",
       "                    \"31\"\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u6708\",\n",
       "                    \"36\"\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u6708\",\n",
       "                    \"39\"\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u6708\",\n",
       "                    \"26\"\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u6708\",\n",
       "                    \"15\"\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u6708\",\n",
       "                    \"16\"\n",
       "                ],\n",
       "                [\n",
       "                    \"8\\u6708\",\n",
       "                    \"24\"\n",
       "                ],\n",
       "                [\n",
       "                    \"9\\u6708\",\n",
       "                    \"29\"\n",
       "                ],\n",
       "                [\n",
       "                    \"10\\u6708\",\n",
       "                    \"43\"\n",
       "                ],\n",
       "                [\n",
       "                    \"11\\u6708\",\n",
       "                    \"47\"\n",
       "                ],\n",
       "                [\n",
       "                    \"12\\u6708\",\n",
       "                    \"54\"\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"color\": \"orange\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 983198\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5317\\u4eac\",\n",
       "                \"\\u4e0a\\u6d77\",\n",
       "                \"\\u5e7f\\u5dde\",\n",
       "                \"\\u6df1\\u5733\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"8%\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"category\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"1\\u6708\",\n",
       "                \"2\\u6708\",\n",
       "                \"3\\u6708\",\n",
       "                \"4\\u6708\",\n",
       "                \"5\\u6708\",\n",
       "                \"6\\u6708\",\n",
       "                \"7\\u6708\",\n",
       "                \"8\\u6708\",\n",
       "                \"9\\u6708\",\n",
       "                \"10\\u6708\",\n",
       "                \"11\\u6708\",\n",
       "                \"12\\u6708\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ]\n",
       "};\n",
       "myChart_60c99b13f772455fa93d1587669968b3.setOption(option_60c99b13f772455fa93d1587669968b3);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.line.Line at 0x2577cf9ae80>"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "line1 = Line(\"2020年北上广深PM2.5全年走势图\", title_pos='center', title_top='0', width=800, height=400)\n",
    "line1.add(\"北京\", attr, s[0], line_color='red', legend_top='8%')\n",
    "line1.add(\"上海\", attr, s[1], line_color='purple', legend_top='8%')\n",
    "line1.add(\"广州\", attr, s[2], line_color='blue', legend_top='8%')\n",
    "line1.add(\"深圳\", attr, s[3], line_color='orange', legend_top='8%')\n",
    "# line.render(\"2020年北上广深PM2.5全年走势图.html\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"580a42f05ee242979bdedc287e2eea09\" style=\"width:1200px;height:720px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_580a42f05ee242979bdedc287e2eea09 = echarts.init(document.getElementById('580a42f05ee242979bdedc287e2eea09'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_580a42f05ee242979bdedc287e2eea09 = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"2020\\u5e74\\u5317\\u4e0a\\u5e7f\\u6df1PM2.5\\u5168\\u5e74\\u8d70\\u52bf\\u56fe\",\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"50%\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"text\": \"2020\\u5e74\\u5317\\u4e0a\\u5e7f\\u6df1AQI\\u5168\\u5e74\\u8d70\\u52bf\\u56fe\",\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"0\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 7225062,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5317\\u4eac\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u6708\",\n",
       "                    \"58\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u6708\",\n",
       "                    \"61\"\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u6708\",\n",
       "                    \"34\"\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u6708\",\n",
       "                    \"30\"\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u6708\",\n",
       "                    \"35\"\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u6708\",\n",
       "                    \"31\"\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u6708\",\n",
       "                    \"40\"\n",
       "                ],\n",
       "                [\n",
       "                    \"8\\u6708\",\n",
       "                    \"28\"\n",
       "                ],\n",
       "                [\n",
       "                    \"9\\u6708\",\n",
       "                    \"23\"\n",
       "                ],\n",
       "                [\n",
       "                    \"10\\u6708\",\n",
       "                    \"41\"\n",
       "                ],\n",
       "                [\n",
       "                    \"11\\u6708\",\n",
       "                    \"36\"\n",
       "                ],\n",
       "                [\n",
       "                    \"12\\u6708\",\n",
       "                    \"27\"\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"color\": \"red\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 7225062,\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 0\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u4e0a\\u6d77\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u6708\",\n",
       "                    \"52\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u6708\",\n",
       "                    \"32\"\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u6708\",\n",
       "                    \"26\"\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u6708\",\n",
       "                    \"32\"\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u6708\",\n",
       "                    \"38\"\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u6708\",\n",
       "                    \"29\"\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u6708\",\n",
       "                    \"26\"\n",
       "                ],\n",
       "                [\n",
       "                    \"8\\u6708\",\n",
       "                    \"19\"\n",
       "                ],\n",
       "                [\n",
       "                    \"9\\u6708\",\n",
       "                    \"24\"\n",
       "                ],\n",
       "                [\n",
       "                    \"10\\u6708\",\n",
       "                    \"18\"\n",
       "                ],\n",
       "                [\n",
       "                    \"11\\u6708\",\n",
       "                    \"25\"\n",
       "                ],\n",
       "                [\n",
       "                    \"12\\u6708\",\n",
       "                    \"46\"\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"color\": \"purple\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 7225062,\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 0\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5e7f\\u5dde\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u6708\",\n",
       "                    \"28\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u6708\",\n",
       "                    \"23\"\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u6708\",\n",
       "                    \"20\"\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u6708\",\n",
       "                    \"26\"\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u6708\",\n",
       "                    \"17\"\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u6708\",\n",
       "                    \"11\"\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u6708\",\n",
       "                    \"11\"\n",
       "                ],\n",
       "                [\n",
       "                    \"8\\u6708\",\n",
       "                    \"17\"\n",
       "                ],\n",
       "                [\n",
       "                    \"9\\u6708\",\n",
       "                    \"20\"\n",
       "                ],\n",
       "                [\n",
       "                    \"10\\u6708\",\n",
       "                    \"26\"\n",
       "                ],\n",
       "                [\n",
       "                    \"11\\u6708\",\n",
       "                    \"31\"\n",
       "                ],\n",
       "                [\n",
       "                    \"12\\u6708\",\n",
       "                    \"34\"\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"color\": \"blue\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 7225062,\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 0\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u6df1\\u5733\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u6708\",\n",
       "                    \"42\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u6708\",\n",
       "                    \"31\"\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u6708\",\n",
       "                    \"36\"\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u6708\",\n",
       "                    \"39\"\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u6708\",\n",
       "                    \"26\"\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u6708\",\n",
       "                    \"15\"\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u6708\",\n",
       "                    \"16\"\n",
       "                ],\n",
       "                [\n",
       "                    \"8\\u6708\",\n",
       "                    \"24\"\n",
       "                ],\n",
       "                [\n",
       "                    \"9\\u6708\",\n",
       "                    \"29\"\n",
       "                ],\n",
       "                [\n",
       "                    \"10\\u6708\",\n",
       "                    \"43\"\n",
       "                ],\n",
       "                [\n",
       "                    \"11\\u6708\",\n",
       "                    \"47\"\n",
       "                ],\n",
       "                [\n",
       "                    \"12\\u6708\",\n",
       "                    \"54\"\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"color\": \"orange\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 7225062,\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 0\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5317\\u4eac\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u6708\",\n",
       "                    \"80\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u6708\",\n",
       "                    \"85\"\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u6708\",\n",
       "                    \"59\"\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u6708\",\n",
       "                    \"59\"\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u6708\",\n",
       "                    \"65\"\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u6708\",\n",
       "                    \"67\"\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u6708\",\n",
       "                    \"65\"\n",
       "                ],\n",
       "                [\n",
       "                    \"8\\u6708\",\n",
       "                    \"49\"\n",
       "                ],\n",
       "                [\n",
       "                    \"9\\u6708\",\n",
       "                    \"41\"\n",
       "                ],\n",
       "                [\n",
       "                    \"10\\u6708\",\n",
       "                    \"69\"\n",
       "                ],\n",
       "                [\n",
       "                    \"11\\u6708\",\n",
       "                    \"60\"\n",
       "                ],\n",
       "                [\n",
       "                    \"12\\u6708\",\n",
       "                    \"50\"\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"color\": \"red\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 7972774,\n",
       "            \"xAxisIndex\": 1,\n",
       "            \"yAxisIndex\": 1\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u4e0a\\u6d77\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u6708\",\n",
       "                    \"72\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u6708\",\n",
       "                    \"47\"\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u6708\",\n",
       "                    \"45\"\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u6708\",\n",
       "                    \"54\"\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u6708\",\n",
       "                    \"62\"\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u6708\",\n",
       "                    \"45\"\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u6708\",\n",
       "                    \"42\"\n",
       "                ],\n",
       "                [\n",
       "                    \"8\\u6708\",\n",
       "                    \"36\"\n",
       "                ],\n",
       "                [\n",
       "                    \"9\\u6708\",\n",
       "                    \"44\"\n",
       "                ],\n",
       "                [\n",
       "                    \"10\\u6708\",\n",
       "                    \"38\"\n",
       "                ],\n",
       "                [\n",
       "                    \"11\\u6708\",\n",
       "                    \"45\"\n",
       "                ],\n",
       "                [\n",
       "                    \"12\\u6708\",\n",
       "                    \"67\"\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"color\": \"purple\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 7972774,\n",
       "            \"xAxisIndex\": 1,\n",
       "            \"yAxisIndex\": 1\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5e7f\\u5dde\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u6708\",\n",
       "                    \"47\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u6708\",\n",
       "                    \"37\"\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u6708\",\n",
       "                    \"38\"\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u6708\",\n",
       "                    \"49\"\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u6708\",\n",
       "                    \"37\"\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u6708\",\n",
       "                    \"27\"\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u6708\",\n",
       "                    \"30\"\n",
       "                ],\n",
       "                [\n",
       "                    \"8\\u6708\",\n",
       "                    \"36\"\n",
       "                ],\n",
       "                [\n",
       "                    \"9\\u6708\",\n",
       "                    \"39\"\n",
       "                ],\n",
       "                [\n",
       "                    \"10\\u6708\",\n",
       "                    \"46\"\n",
       "                ],\n",
       "                [\n",
       "                    \"11\\u6708\",\n",
       "                    \"54\"\n",
       "                ],\n",
       "                [\n",
       "                    \"12\\u6708\",\n",
       "                    \"54\"\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"color\": \"blue\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 7972774,\n",
       "            \"xAxisIndex\": 1,\n",
       "            \"yAxisIndex\": 1\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u6df1\\u5733\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1\\u6708\",\n",
       "                    \"42\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2\\u6708\",\n",
       "                    \"31\"\n",
       "                ],\n",
       "                [\n",
       "                    \"3\\u6708\",\n",
       "                    \"36\"\n",
       "                ],\n",
       "                [\n",
       "                    \"4\\u6708\",\n",
       "                    \"39\"\n",
       "                ],\n",
       "                [\n",
       "                    \"5\\u6708\",\n",
       "                    \"26\"\n",
       "                ],\n",
       "                [\n",
       "                    \"6\\u6708\",\n",
       "                    \"15\"\n",
       "                ],\n",
       "                [\n",
       "                    \"7\\u6708\",\n",
       "                    \"16\"\n",
       "                ],\n",
       "                [\n",
       "                    \"8\\u6708\",\n",
       "                    \"24\"\n",
       "                ],\n",
       "                [\n",
       "                    \"9\\u6708\",\n",
       "                    \"29\"\n",
       "                ],\n",
       "                [\n",
       "                    \"10\\u6708\",\n",
       "                    \"43\"\n",
       "                ],\n",
       "                [\n",
       "                    \"11\\u6708\",\n",
       "                    \"47\"\n",
       "                ],\n",
       "                [\n",
       "                    \"12\\u6708\",\n",
       "                    \"54\"\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"color\": \"orange\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 7972774,\n",
       "            \"xAxisIndex\": 1,\n",
       "            \"yAxisIndex\": 1\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5317\\u4eac\",\n",
       "                \"\\u4e0a\\u6d77\",\n",
       "                \"\\u5e7f\\u5dde\",\n",
       "                \"\\u6df1\\u5733\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"8%\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5317\\u4eac\",\n",
       "                \"\\u4e0a\\u6d77\",\n",
       "                \"\\u5e7f\\u5dde\",\n",
       "                \"\\u6df1\\u5733\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"8%\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"category\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"1\\u6708\",\n",
       "                \"2\\u6708\",\n",
       "                \"3\\u6708\",\n",
       "                \"4\\u6708\",\n",
       "                \"5\\u6708\",\n",
       "                \"6\\u6708\",\n",
       "                \"7\\u6708\",\n",
       "                \"8\\u6708\",\n",
       "                \"9\\u6708\",\n",
       "                \"10\\u6708\",\n",
       "                \"11\\u6708\",\n",
       "                \"12\\u6708\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"category\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"1\\u6708\",\n",
       "                \"2\\u6708\",\n",
       "                \"3\\u6708\",\n",
       "                \"4\\u6708\",\n",
       "                \"5\\u6708\",\n",
       "                \"6\\u6708\",\n",
       "                \"7\\u6708\",\n",
       "                \"8\\u6708\",\n",
       "                \"9\\u6708\",\n",
       "                \"10\\u6708\",\n",
       "                \"11\\u6708\",\n",
       "                \"12\\u6708\"\n",
       "            ],\n",
       "            \"gridIndex\": 7\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"gridIndex\": 7\n",
       "        }\n",
       "    ],\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ],\n",
       "    \"grid\": [\n",
       "        {\n",
       "            \"bottom\": \"60%\"\n",
       "        },\n",
       "        {\n",
       "            \"bottom\": \"60%\"\n",
       "        },\n",
       "        {\n",
       "            \"bottom\": \"60%\"\n",
       "        },\n",
       "        {\n",
       "            \"bottom\": \"60%\"\n",
       "        },\n",
       "        {\n",
       "            \"top\": \"60%\"\n",
       "        },\n",
       "        {\n",
       "            \"top\": \"60%\"\n",
       "        },\n",
       "        {\n",
       "            \"top\": \"60%\"\n",
       "        },\n",
       "        {\n",
       "            \"top\": \"60%\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "myChart_580a42f05ee242979bdedc287e2eea09.setOption(option_580a42f05ee242979bdedc287e2eea09);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.custom.grid.Grid at 0x2577cf6aeb0>"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 将两个折现图上下叠放\n",
    "line1 = Line(\"2020年北上广深PM2.5全年走势图\", title_pos='center', title_top='50%', width=800, height=400)\n",
    "line1.add(\"北京\", attr, s[0], line_color='red', legend_top='8%')\n",
    "line1.add(\"上海\", attr, s[1], line_color='purple', legend_top='8%')\n",
    "line1.add(\"广州\", attr, s[2], line_color='blue', legend_top='8%')\n",
    "line1.add(\"深圳\", attr, s[3], line_color='orange', legend_top='8%')\n",
    "grid = Grid(height=720, width=1200)\n",
    "grid.add(line1, grid_bottom=\"60%\")\n",
    "grid.add(line, grid_top=\"60%\")\n",
    "# grid.render(\"2020年北上广深AQI全年走势图及PM2.5全年走势图.html\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2020年北上广深PM2.5指数日历图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyecharts import HeatMap\n",
    "import datetime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>日期</th>\n",
       "      <th>PM2.5指数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2020-01-01</td>\n",
       "      <td>41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2020-01-02</td>\n",
       "      <td>39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2020-01-03</td>\n",
       "      <td>43</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2020-01-04</td>\n",
       "      <td>68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2020-01-05</td>\n",
       "      <td>40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>361</th>\n",
       "      <td>2020-12-27</td>\n",
       "      <td>71</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>362</th>\n",
       "      <td>2020-12-28</td>\n",
       "      <td>56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>363</th>\n",
       "      <td>2020-12-29</td>\n",
       "      <td>40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>364</th>\n",
       "      <td>2020-12-30</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>365</th>\n",
       "      <td>2020-12-31</td>\n",
       "      <td>18</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>366 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "             日期 PM2.5指数\n",
       "0    2020-01-01      41\n",
       "1    2020-01-02      39\n",
       "2    2020-01-03      43\n",
       "3    2020-01-04      68\n",
       "4    2020-01-05      40\n",
       "..          ...     ...\n",
       "361  2020-12-27      71\n",
       "362  2020-12-28      56\n",
       "363  2020-12-29      40\n",
       "364  2020-12-30      10\n",
       "365  2020-12-31      18\n",
       "\n",
       "[366 rows x 2 columns]"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "v1 = [\"{}\".format(int(i)) for i in np.array(df2['PM'])]  # 提取PM2.5指数建立数组存入字典\n",
    "begin = datetime.date(2020, 1, 1)  # 设立开始日期\n",
    "end = datetime.date(2020, 12, 31) # 设立结束日期\n",
    "data = [[str(begin + datetime.timedelta(days=i)), v1[i]] for i in range((end - begin).days + 1)]  #构建日期和PM2.5指数的数组\n",
    "data03=pd.DataFrame(data)\n",
    "data03.columns=['日期','PM2.5指数'] # 直接修改列名\n",
    "data03"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"08d48980228944179ebe5d1b26a3828c\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_08d48980228944179ebe5d1b26a3828c = echarts.init(document.getElementById('08d48980228944179ebe5d1b26a3828c'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_08d48980228944179ebe5d1b26a3828c = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"2020\\u5e74\\u5e7f\\u5ddePM2.5\\u6307\\u6570\\u65e5\\u5386\\u56fe\",\n",
       "            \"left\": \"40%\",\n",
       "            \"top\": \"10\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"98%\",\n",
       "        \"top\": \"26%\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 4018600,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"heatmap\",\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"2020-01-01\",\n",
       "                    \"41\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-02\",\n",
       "                    \"39\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-03\",\n",
       "                    \"43\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-04\",\n",
       "                    \"68\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-05\",\n",
       "                    \"40\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-06\",\n",
       "                    \"24\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-07\",\n",
       "                    \"30\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-08\",\n",
       "                    \"30\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-09\",\n",
       "                    \"34\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-10\",\n",
       "                    \"33\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-11\",\n",
       "                    \"36\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-12\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-13\",\n",
       "                    \"28\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-14\",\n",
       "                    \"38\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-15\",\n",
       "                    \"32\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-16\",\n",
       "                    \"31\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-17\",\n",
       "                    \"11\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-18\",\n",
       "                    \"23\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-19\",\n",
       "                    \"25\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-20\",\n",
       "                    \"24\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-21\",\n",
       "                    \"35\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-22\",\n",
       "                    \"25\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-23\",\n",
       "                    \"25\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-24\",\n",
       "                    \"19\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-25\",\n",
       "                    \"29\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-26\",\n",
       "                    \"7\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-27\",\n",
       "                    \"9\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-28\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-29\",\n",
       "                    \"22\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-30\",\n",
       "                    \"28\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-01-31\",\n",
       "                    \"29\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-01\",\n",
       "                    \"39\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-02\",\n",
       "                    \"35\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-03\",\n",
       "                    \"42\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-04\",\n",
       "                    \"4\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-05\",\n",
       "                    \"11\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-06\",\n",
       "                    \"16\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-07\",\n",
       "                    \"16\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-08\",\n",
       "                    \"8\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-09\",\n",
       "                    \"16\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-10\",\n",
       "                    \"24\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-11\",\n",
       "                    \"43\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-12\",\n",
       "                    \"35\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-13\",\n",
       "                    \"21\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-14\",\n",
       "                    \"10\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-15\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-16\",\n",
       "                    \"3\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-17\",\n",
       "                    \"13\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-18\",\n",
       "                    \"14\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-19\",\n",
       "                    \"33\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-20\",\n",
       "                    \"35\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-21\",\n",
       "                    \"30\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-22\",\n",
       "                    \"43\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-23\",\n",
       "                    \"38\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-24\",\n",
       "                    \"25\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-25\",\n",
       "                    \"21\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-26\",\n",
       "                    \"21\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-27\",\n",
       "                    \"22\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-28\",\n",
       "                    \"19\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-02-29\",\n",
       "                    \"25\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-01\",\n",
       "                    \"18\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-02\",\n",
       "                    \"19\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-03\",\n",
       "                    \"25\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-04\",\n",
       "                    \"7\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-05\",\n",
       "                    \"10\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-06\",\n",
       "                    \"21\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-07\",\n",
       "                    \"23\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-08\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-09\",\n",
       "                    \"13\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-10\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-11\",\n",
       "                    \"32\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-12\",\n",
       "                    \"34\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-13\",\n",
       "                    \"26\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-14\",\n",
       "                    \"21\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-15\",\n",
       "                    \"37\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-16\",\n",
       "                    \"30\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-17\",\n",
       "                    \"26\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-18\",\n",
       "                    \"34\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-19\",\n",
       "                    \"21\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-20\",\n",
       "                    \"27\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-21\",\n",
       "                    \"22\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-22\",\n",
       "                    \"20\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-23\",\n",
       "                    \"25\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-24\",\n",
       "                    \"25\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-25\",\n",
       "                    \"20\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-26\",\n",
       "                    \"17\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-27\",\n",
       "                    \"15\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-28\",\n",
       "                    \"9\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-29\",\n",
       "                    \"23\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-30\",\n",
       "                    \"5\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-03-31\",\n",
       "                    \"8\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-01\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-02\",\n",
       "                    \"22\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-03\",\n",
       "                    \"13\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-04\",\n",
       "                    \"9\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-05\",\n",
       "                    \"11\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-06\",\n",
       "                    \"13\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-07\",\n",
       "                    \"20\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-08\",\n",
       "                    \"45\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-09\",\n",
       "                    \"44\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-10\",\n",
       "                    \"25\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-11\",\n",
       "                    \"31\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-12\",\n",
       "                    \"8\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-13\",\n",
       "                    \"23\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-14\",\n",
       "                    \"59\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-15\",\n",
       "                    \"62\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-16\",\n",
       "                    \"35\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-17\",\n",
       "                    \"24\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-18\",\n",
       "                    \"27\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-19\",\n",
       "                    \"25\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-20\",\n",
       "                    \"20\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-21\",\n",
       "                    \"17\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-22\",\n",
       "                    \"10\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-23\",\n",
       "                    \"9\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-24\",\n",
       "                    \"16\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-25\",\n",
       "                    \"31\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-26\",\n",
       "                    \"35\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-27\",\n",
       "                    \"35\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-28\",\n",
       "                    \"47\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-29\",\n",
       "                    \"25\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-04-30\",\n",
       "                    \"30\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-01\",\n",
       "                    \"21\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-02\",\n",
       "                    \"21\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-03\",\n",
       "                    \"20\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-04\",\n",
       "                    \"18\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-05\",\n",
       "                    \"13\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-06\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-07\",\n",
       "                    \"10\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-08\",\n",
       "                    \"9\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-09\",\n",
       "                    \"11\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-10\",\n",
       "                    \"13\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-11\",\n",
       "                    \"18\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-12\",\n",
       "                    \"23\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-13\",\n",
       "                    \"42\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-14\",\n",
       "                    \"21\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-15\",\n",
       "                    \"16\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-16\",\n",
       "                    \"14\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-17\",\n",
       "                    \"20\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-18\",\n",
       "                    \"20\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-19\",\n",
       "                    \"21\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-20\",\n",
       "                    \"16\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-21\",\n",
       "                    \"13\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-22\",\n",
       "                    \"9\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-23\",\n",
       "                    \"21\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-24\",\n",
       "                    \"22\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-25\",\n",
       "                    \"13\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-26\",\n",
       "                    \"15\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-27\",\n",
       "                    \"18\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-28\",\n",
       "                    \"33\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-29\",\n",
       "                    \"23\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-30\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-05-31\",\n",
       "                    \"14\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-01\",\n",
       "                    \"16\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-02\",\n",
       "                    \"13\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-03\",\n",
       "                    \"14\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-04\",\n",
       "                    \"11\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-05\",\n",
       "                    \"10\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-06\",\n",
       "                    \"14\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-07\",\n",
       "                    \"17\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-08\",\n",
       "                    \"14\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-09\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-10\",\n",
       "                    \"16\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-11\",\n",
       "                    \"11\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-12\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-13\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-14\",\n",
       "                    \"6\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-15\",\n",
       "                    \"10\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-16\",\n",
       "                    \"7\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-17\",\n",
       "                    \"9\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-18\",\n",
       "                    \"10\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-19\",\n",
       "                    \"10\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-20\",\n",
       "                    \"10\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-21\",\n",
       "                    \"9\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-22\",\n",
       "                    \"10\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-23\",\n",
       "                    \"11\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-24\",\n",
       "                    \"13\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-25\",\n",
       "                    \"10\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-26\",\n",
       "                    \"9\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-27\",\n",
       "                    \"8\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-28\",\n",
       "                    \"9\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-29\",\n",
       "                    \"10\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-06-30\",\n",
       "                    \"11\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-01\",\n",
       "                    \"10\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-02\",\n",
       "                    \"10\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-03\",\n",
       "                    \"10\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-04\",\n",
       "                    \"13\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-05\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-06\",\n",
       "                    \"9\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-07\",\n",
       "                    \"10\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-08\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-09\",\n",
       "                    \"13\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-10\",\n",
       "                    \"11\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-11\",\n",
       "                    \"11\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-12\",\n",
       "                    \"9\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-13\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-14\",\n",
       "                    \"21\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-15\",\n",
       "                    \"14\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-16\",\n",
       "                    \"8\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-17\",\n",
       "                    \"8\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-18\",\n",
       "                    \"8\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-19\",\n",
       "                    \"8\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-20\",\n",
       "                    \"9\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-21\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-22\",\n",
       "                    \"11\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-23\",\n",
       "                    \"11\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-24\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-25\",\n",
       "                    \"16\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-26\",\n",
       "                    \"14\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-27\",\n",
       "                    \"8\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-28\",\n",
       "                    \"10\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-29\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-30\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-07-31\",\n",
       "                    \"10\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-01\",\n",
       "                    \"5\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-02\",\n",
       "                    \"6\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-03\",\n",
       "                    \"9\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-04\",\n",
       "                    \"10\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-05\",\n",
       "                    \"8\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-06\",\n",
       "                    \"11\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-07\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-08\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-09\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-10\",\n",
       "                    \"11\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-11\",\n",
       "                    \"9\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-12\",\n",
       "                    \"9\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-13\",\n",
       "                    \"8\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-14\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-15\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-16\",\n",
       "                    \"13\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-17\",\n",
       "                    \"18\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-18\",\n",
       "                    \"17\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-19\",\n",
       "                    \"5\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-20\",\n",
       "                    \"13\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-21\",\n",
       "                    \"29\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-22\",\n",
       "                    \"35\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-23\",\n",
       "                    \"31\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-24\",\n",
       "                    \"25\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-25\",\n",
       "                    \"19\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-26\",\n",
       "                    \"14\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-27\",\n",
       "                    \"18\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-28\",\n",
       "                    \"33\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-29\",\n",
       "                    \"43\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-30\",\n",
       "                    \"41\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-08-31\",\n",
       "                    \"30\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-01\",\n",
       "                    \"33\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-02\",\n",
       "                    \"42\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-03\",\n",
       "                    \"51\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-04\",\n",
       "                    \"46\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-05\",\n",
       "                    \"26\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-06\",\n",
       "                    \"33\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-07\",\n",
       "                    \"15\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-08\",\n",
       "                    \"13\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-09\",\n",
       "                    \"16\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-10\",\n",
       "                    \"21\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-11\",\n",
       "                    \"14\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-12\",\n",
       "                    \"13\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-13\",\n",
       "                    \"20\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-14\",\n",
       "                    \"23\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-15\",\n",
       "                    \"16\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-16\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-17\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-18\",\n",
       "                    \"10\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-19\",\n",
       "                    \"9\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-20\",\n",
       "                    \"11\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-21\",\n",
       "                    \"14\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-22\",\n",
       "                    \"15\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-23\",\n",
       "                    \"17\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-24\",\n",
       "                    \"14\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-25\",\n",
       "                    \"18\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-26\",\n",
       "                    \"29\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-27\",\n",
       "                    \"10\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-28\",\n",
       "                    \"19\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-29\",\n",
       "                    \"29\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-09-30\",\n",
       "                    \"16\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-01\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-02\",\n",
       "                    \"23\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-03\",\n",
       "                    \"24\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-04\",\n",
       "                    \"34\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-05\",\n",
       "                    \"24\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-06\",\n",
       "                    \"16\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-07\",\n",
       "                    \"13\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-08\",\n",
       "                    \"15\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-09\",\n",
       "                    \"25\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-10\",\n",
       "                    \"30\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-11\",\n",
       "                    \"36\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-12\",\n",
       "                    \"34\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-13\",\n",
       "                    \"29\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-14\",\n",
       "                    \"18\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-15\",\n",
       "                    \"28\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-16\",\n",
       "                    \"27\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-17\",\n",
       "                    \"11\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-18\",\n",
       "                    \"15\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-19\",\n",
       "                    \"13\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-20\",\n",
       "                    \"20\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-21\",\n",
       "                    \"21\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-22\",\n",
       "                    \"20\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-23\",\n",
       "                    \"31\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-24\",\n",
       "                    \"31\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-25\",\n",
       "                    \"36\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-26\",\n",
       "                    \"46\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-27\",\n",
       "                    \"41\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-28\",\n",
       "                    \"41\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-29\",\n",
       "                    \"41\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-30\",\n",
       "                    \"39\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-10-31\",\n",
       "                    \"42\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-01\",\n",
       "                    \"44\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-02\",\n",
       "                    \"42\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-03\",\n",
       "                    \"29\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-04\",\n",
       "                    \"43\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-05\",\n",
       "                    \"49\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-06\",\n",
       "                    \"47\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-07\",\n",
       "                    \"41\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-08\",\n",
       "                    \"36\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-09\",\n",
       "                    \"32\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-10\",\n",
       "                    \"41\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-11\",\n",
       "                    \"34\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-12\",\n",
       "                    \"34\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-13\",\n",
       "                    \"32\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-14\",\n",
       "                    \"32\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-15\",\n",
       "                    \"31\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-16\",\n",
       "                    \"44\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-17\",\n",
       "                    \"26\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-18\",\n",
       "                    \"28\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-19\",\n",
       "                    \"22\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-20\",\n",
       "                    \"37\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-21\",\n",
       "                    \"15\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-22\",\n",
       "                    \"27\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-23\",\n",
       "                    \"25\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-24\",\n",
       "                    \"25\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-25\",\n",
       "                    \"25\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-26\",\n",
       "                    \"33\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-27\",\n",
       "                    \"16\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-28\",\n",
       "                    \"15\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-29\",\n",
       "                    \"17\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-11-30\",\n",
       "                    \"19\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-01\",\n",
       "                    \"22\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-02\",\n",
       "                    \"23\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-03\",\n",
       "                    \"23\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-04\",\n",
       "                    \"23\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-05\",\n",
       "                    \"30\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-06\",\n",
       "                    \"44\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-07\",\n",
       "                    \"46\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-08\",\n",
       "                    \"39\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-09\",\n",
       "                    \"39\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-10\",\n",
       "                    \"42\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-11\",\n",
       "                    \"46\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-12\",\n",
       "                    \"47\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-13\",\n",
       "                    \"52\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-14\",\n",
       "                    \"12\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-15\",\n",
       "                    \"9\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-16\",\n",
       "                    \"15\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-17\",\n",
       "                    \"22\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-18\",\n",
       "                    \"22\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-19\",\n",
       "                    \"25\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-20\",\n",
       "                    \"36\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-21\",\n",
       "                    \"45\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-22\",\n",
       "                    \"47\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-23\",\n",
       "                    \"45\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-24\",\n",
       "                    \"31\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-25\",\n",
       "                    \"45\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-26\",\n",
       "                    \"57\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-27\",\n",
       "                    \"71\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-28\",\n",
       "                    \"56\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-29\",\n",
       "                    \"40\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-30\",\n",
       "                    \"10\"\n",
       "                ],\n",
       "                [\n",
       "                    \"2020-12-31\",\n",
       "                    \"18\"\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"seriesId\": 4018600,\n",
       "            \"coordinateSystem\": \"calendar\"\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"calendar\": {\n",
       "        \"range\": \"2020\",\n",
       "        \"cellSize\": [\n",
       "            \"auto\",\n",
       "            30\n",
       "        ]\n",
       "    },\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ],\n",
       "    \"visualMap\": {\n",
       "        \"type\": \"piecewise\",\n",
       "        \"min\": 0,\n",
       "        \"max\": 300,\n",
       "        \"text\": [\n",
       "            \"\",\n",
       "            \"\"\n",
       "        ],\n",
       "        \"textStyle\": {\n",
       "            \"color\": \"#000\"\n",
       "        },\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"splitNumber\": 6,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"left\": \"26%\",\n",
       "        \"top\": \"70%\",\n",
       "        \"showLabel\": true\n",
       "    }\n",
       "};\n",
       "myChart_08d48980228944179ebe5d1b26a3828c.setOption(option_08d48980228944179ebe5d1b26a3828c);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.heatmap.HeatMap at 0x2577cfb8c70>"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "heatmap = HeatMap(\"2020年广州PM2.5指数日历图\", title_pos='40%', title_top='10', width=800, height=400)  # 设置标题\n",
    "heatmap.add(\n",
    "    \"\",\n",
    "    data, # 填充数据\n",
    "    is_calendar_heatmap=True,\n",
    "    visual_text_color=\"#000\", #  两端文本颜色\n",
    "    visual_range_text=[\"\", \"\"],  # 默认['low','hight']，两端文本\n",
    "    visual_range=[0, 300],  # 默认[0,100]，指定组件的允许的最小值与最大值\n",
    "    calendar_cell_size=[\"auto\", 30],\n",
    "    is_visualmap=True, # 是否使用视觉映射组件\n",
    "    calendar_date_range=\"2020\",\n",
    "    visual_orient=\"horizontal\", # 默认'vertical'，visualMap 组件条的方向。有'vertical', 'horizontal'可选\n",
    "    visual_pos=\"26%\", # 默认'left'，visualmap 组件条距离左侧的位置。有'right', 'center', 'right'可选，也可为百分数或整数\n",
    "    visual_top=\"70%\",  # 默认‘top’,visualmap 组件条距离顶部的位置。有'top', 'center', 'bottom'可选，也可为百分数或整数\n",
    "    is_piecewise=True, # 默认False，是否将组件转换为分段型（默认为连续型）\n",
    "    visual_split_number=6, #  默认5，分段型中分割的段数，在设置为分段型时生效\n",
    ")\n",
    "# heatmap.render('2020年广州PM2.5指数日历图.html')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.5.11\n"
     ]
    }
   ],
   "source": [
    "import pyecharts\n",
    "print(pyecharts.__version__)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {
    "height": "calc(100% - 180px)",
    "left": "10px",
    "top": "150px",
    "width": "335.417px"
   },
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
